home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / swingall.jar / javax / swing / text / StringContent$InsertUndo.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-07-15  |  1.5 KB  |  68 lines

  1. package javax.swing.text;
  2.  
  3. import java.util.Vector;
  4. import javax.swing.undo.AbstractUndoableEdit;
  5. import javax.swing.undo.CannotRedoException;
  6. import javax.swing.undo.CannotUndoException;
  7.  
  8. class StringContent$InsertUndo extends AbstractUndoableEdit {
  9.    // $FF: synthetic field
  10.    private final StringContent this$0;
  11.    protected int offset;
  12.    protected int length;
  13.    protected String string;
  14.    protected Vector posRefs;
  15.  
  16.    protected StringContent$InsertUndo(StringContent var1, int var2, int var3) {
  17.       this.this$0 = var1;
  18.       this.offset = var2;
  19.       this.length = var3;
  20.    }
  21.  
  22.    public void redo() throws CannotRedoException {
  23.       super.redo();
  24.  
  25.       try {
  26.          StringContent var1 = this.this$0;
  27.          synchronized(var1){}
  28.  
  29.          try {
  30.             this.this$0.insertString(this.offset, this.string);
  31.             this.string = null;
  32.             if (this.posRefs != null) {
  33.                this.this$0.updateUndoPositions(this.posRefs);
  34.                this.posRefs = null;
  35.             }
  36.          } catch (Throwable var4) {
  37.             throw var4;
  38.          }
  39.  
  40.       } catch (BadLocationException var5) {
  41.          throw new CannotRedoException();
  42.       }
  43.    }
  44.  
  45.    public void undo() throws CannotUndoException {
  46.       super.undo();
  47.  
  48.       try {
  49.          StringContent var1 = this.this$0;
  50.          synchronized(var1){}
  51.  
  52.          try {
  53.             if (this.this$0.marks != null) {
  54.                this.posRefs = this.this$0.getPositionsInRange((Vector)null, this.offset, this.length);
  55.             }
  56.  
  57.             this.string = this.this$0.getString(this.offset, this.length);
  58.             this.this$0.remove(this.offset, this.length);
  59.          } catch (Throwable var4) {
  60.             throw var4;
  61.          }
  62.  
  63.       } catch (BadLocationException var5) {
  64.          throw new CannotUndoException();
  65.       }
  66.    }
  67. }
  68.